package com.nomi.blog.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.util.Date;

@Data
@TableName("user")
public class User {
    @TableId(value = "id", type = IdType.AUTO)
    //用户ID
    private Long id;
    //账号(手机号)
    private String account;
    //加密后的密码
    @JSONField(serialize = false)   //  JSON序列化时忽略密码字段
    private String password;
    //昵称
    private String nickname;
    //性别(0:女 1:男)
    private Integer gender;
    //年龄
    private Integer age;
    //码龄
    private Integer codingYears;
    //地址
    private String address;
    //邮箱
    private String email;
    //头像
    private byte[] avatar;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")  // JSON序列化时格式化日期
    //注册时间
    private Date createTime;
}
